package com.leadership.training.entity.project;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.annotations.Type;
import org.springframework.format.annotation.DateTimeFormat;
import com.leadership.training.entity.course.Course;
import com.leadership.training.entity.trainer.Trainer;


/**
 * 项目-期-课程
 * @author Rockett
 *
 */
@Entity
@Table(name = "t_project_phase_course")
public class ProjectPhaseCourse {
    
	/**
	 * ID
	 */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    
    /**
     * 项目-期
     */
    @ManyToOne(fetch = FetchType.LAZY, optional = false)
    private ProjectPhase projectPhase;
    
    /**
     * 课程
     */
    @ManyToOne(fetch = FetchType.LAZY, optional = false)
    private Course course;
    
    @ManyToOne(fetch = FetchType.LAZY, optional = true)
    private Trainer trainer;
  
    /**
     * 开始日期
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @Type(type = "date")
    private Date beginDate;
   
    /**讲师评分*/
    private String trainerSurveyResult;
   
    /**课程评分*/
    private String courseSurveyResult;
   
    /**建议*/
    private String surveySuggestion;

	/**
	 * 内容需求匹配度
	 */
	private String piPeiDu;

	/**
	 * 展示技巧
	 */
	private String zsjq;

	/**
	 * 内容理解深度
	 */
	private String ljsd;

	/* 最后更新时间 */
	private Date lastUpadate;
    

    /**
     * 是否可用
     */
    @Column(name = "is_disabled")
    private boolean disabled;
    
    /**
     * 
     * @return
     */
    public ProjectPhaseCourse delete() {
    	this.disabled = true;
    	this.lastUpadate = new Date();
    	return this;
    	
    }

    //内容需求匹配度更新
	/**
	* @description
	* @params * @param piPeiDu
	* @return  void
	* @author  LZJ
	* @date  2019/12/13 14:14 *
	*/
    public void updatePiPeiDu(String piPeiDu){

    	this.piPeiDu = piPeiDu;
    	this.lastUpadate = new Date();
	}

	/**
	 * 展示技巧更新
	 */
	/**
	* @description
	* @params * @param zsjq
	* @return  void
	* @author  LZJ
	* @date  2019/12/13 14:16 *
	*/
	public void updateZsjq(String zsjq){
		this.zsjq = zsjq;
		this.lastUpadate = new Date();
	}

	/**
	 * 内容理解深度更新
	 */
	/**
	* @description
	* @params * @param ljsd
	* @return  void
	* @author  LZJ
	* @date  2019/12/13 14:17 *
	*/
	public void   updateLjsd(String  ljsd){
		this.ljsd = ljsd;
		this.lastUpadate = new Date();
	}


	/**
	* @description  改进建议更新
	* @params * @param surveySuggestion
	* @return  void
	* @author  LZJ
	* @date  2019/12/13 16:33 *
	*/
	public void updateSurveySuggestion(String surveySuggestion) {
		this.surveySuggestion = surveySuggestion;
		this.lastUpadate = new Date();
	}

	/**
	* @description 课程整体评价
	* @params * @param courseSurveyResult
	* @return  void
	* @author  LZJ
	* @date  2019/12/13 16:36 *
	*/
	public void updateCourseSurveyResult(String courseSurveyResult) {
		this.courseSurveyResult = courseSurveyResult;
		this.lastUpadate = new Date();
	}

	/**
	* @description  讲师总体评分
	* @params * @param trainerSurveyResult
	* @return  void
	* @author  LZJ
	* @date  2019/12/13 16:36 *
	*/
	public void updateTrainerSurveyResult(String trainerSurveyResult) {
		this.trainerSurveyResult = trainerSurveyResult;
		this.lastUpadate = new Date();
	}


	/** 
     * 结束日期
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @Type(type = "date")
   private Date endDate;
    
    
    /**
     * The default constructor
     */
    public ProjectPhaseCourse() {
    	this.disabled=false;
    }
    
    public ProjectPhaseCourse(ProjectPhaseCourse oldProjectPhaseCourse) {
        this.course = oldProjectPhaseCourse.getCourse();
        this.trainer = oldProjectPhaseCourse.getTrainer();
        this.beginDate = oldProjectPhaseCourse.getBeginDate();
        this.trainerSurveyResult = null;
        this.courseSurveyResult = null;
        this.lastUpadate = new Date();
        this.disabled = false;
    }
    
    /**
     * @param trainer
     * @param projectPhase
     * @param course
     */
    public ProjectPhaseCourse(Trainer trainer, ProjectPhase projectPhase, Course course) {
        this.course = course;
        this.projectPhase = projectPhase;
        this.trainer = trainer;
        this.lastUpadate = new Date();
        this.disabled = false;
    }
    
    /**
     * @param trainer
     * @return
     */
    public ProjectPhaseCourse editTrainer(Trainer trainer) {
        this.trainer = trainer;
        this.lastUpadate = new Date();
        return this;
    }
    
    public ProjectPhaseCourse editProjectPhaseCourse(Trainer trainer, Course course) {
        this.course = course;
        this.trainer = trainer;
        this.lastUpadate = new Date();
        return this;
    }
    
    /**
     * 
     * @param projectPhase
     * @return
     */
    public ProjectPhaseCourse init(ProjectPhase projectPhase) {
        this.projectPhase = projectPhase;
        this.lastUpadate = new Date();
        return this;
    }
    
    /**
     * @return
     */
    public ProjectPhaseCourse editDisabled() {
        this.disabled = true;
        this.lastUpadate = new Date();
        return this;
    }


	/**
	 * 获取 ID
	 *
	 * @return id ID
	 */
	public Long getId() {
		return this.id;
	}

	/**
	 * 设置 ID
	 *
	 * @param id ID
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * 获取 项目-期
	 *
	 * @return projectPhase 项目-期
	 */
	public ProjectPhase getProjectPhase() {
		return this.projectPhase;
	}

	/**
	 * 设置 项目-期
	 *
	 * @param projectPhase 项目-期
	 */
	public void setProjectPhase(ProjectPhase projectPhase) {
		this.projectPhase = projectPhase;
	}

	/**
	 * 获取 课程
	 *
	 * @return course 课程
	 */
	public Course getCourse() {
		return this.course;
	}

	/**
	 * 设置 课程
	 *
	 * @param course 课程
	 */
	public void setCourse(Course course) {
		this.course = course;
	}

	/**
	 * 获取 @ManyToOne(fetch = FetchType.LAZY optional = true)
	 *
	 * @return trainer @ManyToOne(fetch = FetchType.LAZY optional = true)
	 */
	public Trainer getTrainer() {
		return this.trainer;
	}

	/**
	 * 设置 @ManyToOne(fetch = FetchType.LAZY optional = true)
	 *
	 * @param trainer @ManyToOne(fetch = FetchType.LAZY optional = true)
	 */
	public void setTrainer(Trainer trainer) {
		this.trainer = trainer;
	}

	/**
	 * 获取 开始日期
	 *
	 * @return beginDate 开始日期
	 */
	public Date getBeginDate() {
		return this.beginDate;
	}

	/**
	 * 设置 开始日期
	 *
	 * @param beginDate 开始日期
	 */
	public void setBeginDate(Date beginDate) {
		this.beginDate = beginDate;
	}

	/**
	 * 获取 讲师评分
	 *
	 * @return trainerSurveyResult 讲师评分
	 */
	public String getTrainerSurveyResult() {
		return this.trainerSurveyResult;
	}

	/**
	 * 设置 讲师评分
	 *
	 * @param trainerSurveyResult 讲师评分
	 */
	public void setTrainerSurveyResult(String trainerSurveyResult) {
		this.trainerSurveyResult = trainerSurveyResult;
	}

	/**
	 * 获取 课程评分
	 *
	 * @return courseSurveyResult 课程评分
	 */
	public String getCourseSurveyResult() {
		return this.courseSurveyResult;
	}

	/**
	 * 设置 课程评分
	 *
	 * @param courseSurveyResult 课程评分
	 */
	public void setCourseSurveyResult(String courseSurveyResult) {
		this.courseSurveyResult = courseSurveyResult;
	}

	/**
	 * 获取 建议
	 *
	 * @return surveySuggestion 建议
	 */
	public String getSurveySuggestion() {
		return this.surveySuggestion;
	}

	/**
	 * 设置 建议
	 *
	 * @param surveySuggestion 建议
	 */
	public void setSurveySuggestion(String surveySuggestion) {
		this.surveySuggestion = surveySuggestion;
	}

	/**
	 * 获取 内容需求匹配度
	 *
	 * @return piPeiDu 内容需求匹配度
	 */
	public String getPiPeiDu() {
		return this.piPeiDu;
	}

	/**
	 * 设置 内容需求匹配度
	 *
	 * @param piPeiDu 内容需求匹配度
	 */
	public void setPiPeiDu(String piPeiDu) {
		this.piPeiDu = piPeiDu;
	}

	/**
	 * 获取 展示技巧
	 *
	 * @return zsjq 展示技巧
	 */
	public String getZsjq() {
		return this.zsjq;
	}

	/**
	 * 设置 展示技巧
	 *
	 * @param zsjq 展示技巧
	 */
	public void setZsjq(String zsjq) {
		this.zsjq = zsjq;
	}

	/**
	 * 获取 内容理解深度
	 *
	 * @return ljsd 内容理解深度
	 */
	public String getLjsd() {
		return this.ljsd;
	}

	/**
	 * 设置 内容理解深度
	 *
	 * @param ljsd 内容理解深度
	 */
	public void setLjsd(String ljsd) {
		this.ljsd = ljsd;
	}

	/**
	 * 获取 最后更新时间
	 *
	 * @return lastUpadate 最后更新时间
	 */
	public Date getLastUpadate() {
		return this.lastUpadate;
	}

	/**
	 * 设置 最后更新时间
	 *
	 * @param lastUpadate 最后更新时间
	 */
	public void setLastUpadate(Date lastUpadate) {
		this.lastUpadate = lastUpadate;
	}

	/**
	 * 获取 是否可用
	 *
	 * @return disabled 是否可用
	 */
	public boolean isDisabled() {
		return this.disabled;
	}

	/**
	 * 设置 是否可用
	 *
	 * @param disabled 是否可用
	 */
	public void setDisabled(boolean disabled) {
		this.disabled = disabled;
	}

	/**
	 * 获取 结束日期
	 *
	 * @return endDate 结束日期
	 */
	public Date getEndDate() {
		return this.endDate;
	}

	/**
	 * 设置 结束日期
	 *
	 * @param endDate 结束日期
	 */
	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

}